﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DXApplicationTangche.UC.销售台账.service;
using DevExpress.XtraGrid.Demos.util;

namespace DXApplicationTangche.UC.生产下单
{
    public partial class Form销售日记账确认预览 : DevExpress.XtraEditors.XtraForm
    {
        private List<销售日记账预览VO> 销售日记账预览VOs = new List<销售日记账预览VO>();
        public Form销售日记账确认预览(List<销售日记账预览VO> 销售日记账预览VOs)
        {
            InitializeComponent();
            this.销售日记账预览VOs = 销售日记账预览VOs;
            this.gridControl销售日记账确认预览.DataSource = this.销售日记账预览VOs;
            this.gridView销售日记账确认预览.RefreshData();
        }

        private void simpleButton确认排产_Click(object sender, EventArgs e)
        {
            List<OrderDailyConfirmDTO> orderDailyConfirmDTOs = new List<OrderDailyConfirmDTO>();
            foreach (销售日记账预览VO item in this.销售日记账预览VOs)
            {
                orderDailyConfirmDTOs.Add(new OrderDailyConfirmDTO(item));
            }
            FunctionHelper.JsonSerialization(orderDailyConfirmDTOs);
            销售台账Service.post确认销售台账(orderDailyConfirmDTOs);
            MessageBox.Show("确认完成");
            this.Close();
        }
    }
}